﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ClownStopper
{
    public delegate void OnReceiveMessageDelegate(object sender, ReceiveMessageEventArgs e);
    public delegate void OnErrorDelegate(object sender, ErrorEventArgs e);

    public delegate void ServerRegisterEvent(object sender, ServerRegisterEventArgs e);
    public delegate void OnReceiveServerMessageDelegate(object sender, ReceiveServerMessageEventArgs e);

    public class ServerRegisterEventArgs : EventArgs
    {
        private readonly IMessageClientDetails _mNewClient;

        public ServerRegisterEventArgs(IMessageClientDetails newClient)
        {
            _mNewClient = newClient;
        }

        public IMessageClientDetails NewClient
        {
            get { return _mNewClient; }
        }
    } ;

    public class ReceiveServerMessageEventArgs : EventArgs
    {
        public string ClientIp { get; set; }
        public ReceiveServerMessageEventArgs(IMessage newMessage, string clientIp)
        {
            Message = newMessage;
            ClientIp = clientIp;
        }

        public IMessage Message { get; set; }
    }


    public enum MessageType
    {
        EmptyMessage,
        RegisterMessage,
        UnregisterMessage,
        ResgisteredClientsListMessage,
        TextDataMessage,
        ImageDataMessage,
        StrokeDataMessage,
        CustomMessage,
        BingoMessage,
    }

    public class ReceiveMessageEventArgs : EventArgs
    {
        public ReceiveMessageEventArgs(IMessage newMessage)
        {
            Message = newMessage;
        }

        public IMessage Message { get; set; }
    }

    public class ErrorEventArgs : EventArgs
    {
        public ErrorEventArgs(string error)
        {
            Message = error;
        }

        public string Message { get; set; }
    }
}
